package com.lottery.ruok.lottrey.adapter;

import android.content.Context;
import android.view.View;

import com.applozic.mobicomkit.contact.AppContactService;
import com.lottery.ruok.lottrey.adapter.recyclleradapter.BaseAppRecyclerViewAdapter;
import com.lottery.ruok.lottrey.retrofitModule.response.GetRoomUsersResponse;
import com.lottery.ruok.lottrey.ui.component.ChannelItemView;

import java.util.List;

/**
 * Created by ASUS on 2017/9/18.
 */

public class RecodeChatAdapter extends BaseAppRecyclerViewAdapter<GetRoomUsersResponse.ListBean> {

    private AppContactService appContactService;

    public RecodeChatAdapter(Context context) {
        this(context, null);
    }

    public RecodeChatAdapter(Context context, List<GetRoomUsersResponse.ListBean> list) {
        super(context, list);
        this.appContactService = new AppContactService(mContext);

    }

    @Override
    protected View createItemView(Context mContext, int viewType) {
        return new ChannelItemView(mContext);
    }


    @Override
    protected void onBindView(View itemView, int position) {
        if (itemView instanceof ChannelItemView) {
            ChannelItemView view = (ChannelItemView) itemView;
            view.setAppContactService(appContactService);
            view.setData(getList().get(position), null);
        }
    }
}
